/**********************************************************************************************************
** 驱动文件：	jmkt-C7000.c
** 驱动类型：	jmkt
** 设备名称：	精密空调
** 设备型号：	C7000
** 设备品牌：	世图兹
** 设备协议：	Modbus-RTU
** 驱动描述：	适用于世图兹控制器为C7000，CPD或CSD型精密空调，例如CPD512A、CSD521A
。
** 生成日期：	2020-05-17 21:57:08
**********************************************************************************************************/
#include "Includes.h"


/**********************************************************************************************************
* 定义设备数据点变量结构
**********************************************************************************************************/
typedef struct{
	Var OnOffStatus;							//开关机状态
	Var CoolingMode;							//制冷模式
	Var HeatingMode;							//加热模式
	Var HumidificationMode;						//加湿模式
	Var DehumidificationMode;					//除湿模式
	Var WaterDetector;							//漏水报警
	Var PhaseCheck;								//相序报警
	Var FireAlarm;								//火灾报警
	Var ReturnAirTempAlarm;						//回风温度报警
	Var ReturnAirHumidAlarm;					//回风湿度报警
	Var SupplyAirTempAlarm;						//送风温度报警
	Var SupplyAirHumidAlarm;					//送风湿度报警
	Var SetpointTemperatureDay;					//温度设定值（白天）
	Var SetpointTemperatureNight;				//温度设定值（夜晚）
	Var SetpointHumidity;						//湿度设定值
	Var ReturnAirTemperature;					//回风温度
	Var ReturnAirHumidity;						//回风湿度
	Var SupplyAirTemperature;					//送风温度
	Var SupplyAirHumidity;						//送风湿度
	Var ElectricHeatingAlarm;					//电加热报警
	Var ElectricHeating1Running;				//电加热1运行
	Var ElectricHeating2Running;				//电加热2运行
	Var ElectricHeating3Running;				//电加热3运行
	Var Humidifier1Running;						//加湿器运行
	Var Humidifier1Alarm;						//加湿器报警
	Var Fan1FilterAlarm;						//空气过滤网报警
	Var Fan1Running;							//风机运行
	Var fan1Alarm;								//风机报警
	Var Loop1PressureAlarm;						//回路1压力报警
	Var Loop2PressureAlarm;						//回路2压力报警
	Var Compressor1Running;						//压缩机1运行
	Var Compressor2Running;						//压缩机2运行
}Data_Struct;									//定义变量结构


/**********************************************************************************************************
* 设备数据点变量属性声明
**********************************************************************************************************/
const static Var_Property_Def var_attr[] = {
	{
		OCTSTR,
		0,
		READONLY,
		"OnOffStatus",
		"开关机状态",
		"",
		"开关机状态",
		0,
		0,
		"关机",
		"",
		0,
		0
	},
	{
		OCTSTR,
		0,
		READONLY,
		"CoolingMode",
		"制冷模式",
		"",
		"制冷模式",
		0,
		0,
		"停止",
		"",
		0,
		0
	},
	{
		OCTSTR,
		0,
		READONLY,
		"HeatingMode",
		"加热模式",
		"",
		"加热模式",
		0,
		0,
		"停止",
		"",
		0,
		0
	},
	{
		OCTSTR,
		0,
		READONLY,
		"HumidificationMode",
		"加湿模式",
		"",
		"加湿模式",
		0,
		0,
		"停止",
		"",
		0,
		0
	},
	{
		OCTSTR,
		0,
		READONLY,
		"DehumidificationMode",
		"除湿模式",
		"",
		"除湿模式",
		0,
		0,
		"停止",
		"",
		0,
		0
	},
	{
		OCTSTR,
		0,
		READONLY,
		"WaterDetector",
		"漏水报警",
		"",
		"漏水报警",
		0,
		0,
		"报警",
		"",
		0,
		0
	},
	{
		OCTSTR,
		0,
		READONLY,
		"PhaseCheck",
		"相序报警",
		"",
		"相序报警",
		0,
		0,
		"报警",
		"",
		0,
		0
	},
	{
		OCTSTR,
		0,
		READONLY,
		"FireAlarm",
		"火灾报警",
		"",
		"火灾报警",
		0,
		0,
		"报警",
		"",
		0,
		0
	},
	{
		OCTSTR,
		0,
		READONLY,
		"ReturnAirTempAlarm",
		"回风温度报警",
		"",
		"回风温度报警",
		0,
		0,
		"报警",
		"",
		0,
		0
	},
	{
		OCTSTR,
		0,
		READONLY,
		"ReturnAirHumidAlarm",
		"回风湿度报警",
		"",
		"回风湿度报警",
		0,
		0,
		"报警",
		"",
		0,
		0
	},
	{
		OCTSTR,
		0,
		READONLY,
		"SupplyAirTempAlarm",
		"送风温度报警",
		"",
		"送风温度报警",
		0,
		0,
		"报警",
		"",
		0,
		0
	},
	{
		OCTSTR,
		0,
		READONLY,
		"SupplyAirHumidAlarm",
		"送风湿度报警",
		"",
		"送风湿度报警",
		0,
		0,
		"报警",
		"",
		0,
		0
	},
	{
		FLOAT,
		0,
		READONLY,
		"SetpointTemperatureDay",
		"温度设定值（白天）",
		"℃",
		"温度设定值（白天）",
		0,
		0,
		"温度设定值（白天）过高",
		"温度设定值（白天）过低",
		0,
		0
	},
	{
		FLOAT,
		0,
		READONLY,
		"SetpointTemperatureNight",
		"温度设定值（夜晚）",
		"℃",
		"温度设定值（夜晚）",
		0,
		0,
		"温度设定值（夜晚）过高",
		"温度设定值（夜晚）过低",
		0,
		0
	},
	{
		FLOAT,
		0,
		READONLY,
		"SetpointHumidity",
		"湿度设定值",
		"%",
		"湿度设定值",
		0,
		0,
		"湿度设定值过高",
		"湿度设定值过低",
		0,
		0
	},
	{
		FLOAT,
		0,
		READONLY,
		"ReturnAirTemperature",
		"回风温度",
		"℃",
		"回风温度",
		0,
		0,
		"回风温度过高",
		"回风温度过低",
		0,
		0
	},
	{
		FLOAT,
		0,
		READONLY,
		"ReturnAirHumidity",
		"回风湿度",
		"%",
		"回风湿度",
		0,
		0,
		"回风湿度过高",
		"回风湿度过低",
		0,
		0
	},
	{
		FLOAT,
		0,
		READONLY,
		"SupplyAirTemperature",
		"送风温度",
		"℃",
		"送风温度",
		0,
		0,
		"送风温度过高",
		"送风温度过低",
		0,
		0
	},
	{
		FLOAT,
		0,
		READONLY,
		"SupplyAirHumidity",
		"送风湿度",
		"%",
		"送风湿度",
		0,
		0,
		"送风湿度过高",
		"送风湿度过低",
		0,
		0
	},
	{
		OCTSTR,
		0,
		READONLY,
		"ElectricHeatingAlarm",
		"电加热报警",
		"",
		"电加热报警",
		0,
		0,
		"报警",
		"",
		0,
		0
	},
	{
		OCTSTR,
		0,
		READONLY,
		"ElectricHeating1Running",
		"电加热1运行",
		"",
		"电加热1运行",
		0,
		0,
		"停止",
		"",
		0.000,
		0.000
	},
	{
		OCTSTR,
		0,
		READONLY,
		"ElectricHeating2Running",
		"电加热2运行",
		"",
		"电加热2运行",
		0,
		0,
		"停止",
		"",
		0,
		0
	},
	{
		OCTSTR,
		0,
		READONLY,
		"ElectricHeating3Running",
		"电加热3运行",
		"",
		"电加热3运行",
		0,
		0,
		"停止",
		"",
		0.000,
		0.000
	},
	{
		OCTSTR,
		0,
		READONLY,
		"Humidifier1Running",
		"加湿器运行",
		"",
		"加湿器运行",
		0,
		0,
		"停止",
		"",
		0,
		0
	},
	{
		OCTSTR,
		0,
		READONLY,
		"Humidifier1Alarm",
		"加湿器报警",
		"",
		"加湿器报警",
		0,
		0,
		"报警",
		"",
		0,
		0
	},
	{
		OCTSTR,
		0,
		READONLY,
		"Fan1FilterAlarm",
		"空气过滤网报警",
		"",
		"空气过滤网报警",
		0,
		0,
		"报警",
		"",
		0,
		0
	},
	{
		OCTSTR,
		0,
		READONLY,
		"Fan1Running",
		"风机运行",
		"",
		"风机运行",
		0,
		0,
		"停止",
		"",
		0,
		0
	},
	{
		OCTSTR,
		0,
		READONLY,
		"fan1Alarm",
		"风机报警",
		"",
		"风机报警",
		0,
		0,
		"报警",
		"",
		0,
		0
	},
	{
		OCTSTR,
		0,
		READONLY,
		"Loop1PressureAlarm",
		"回路1压力报警",
		"",
		"回路1压力报警",
		0,
		0,
		"报警",
		"",
		0.000,
		0.000
	},
	{
		OCTSTR,
		0,
		READONLY,
		"Loop2PressureAlarm",
		"回路2压力报警",
		"",
		"回路2压力报警",
		0,
		0,
		"报警",
		"",
		0.000,
		0.000
	},
	{
		OCTSTR,
		0,
		READONLY,
		"Compressor1Running",
		"压缩机1运行",
		"",
		"压缩机1运行",
		0,
		0,
		"停止",
		"",
		0.000,
		0.000
	},
	{
		OCTSTR,
		0,
		READONLY,
		"Compressor2Running",
		"压缩机2运行",
		"",
		"压缩机2运行",
		0,
		0,
		"停止",
		"",
		0.000,
		0.000
	}
};


/**********************************************************************************************************
* 函数名称： static void cmd_fun(short index, int addr, void *data, char *cmd, short *len)
* 函数说明： 生成获取传感器数据指令
* 输入参数： 指令索引，传感器地址，变量结构体指针,以及指令缓存区指针,指令长度
* 返回参数： 无
**********************************************************************************************************/
static void cmd_fun(short index, int addr, void *data, char *cmd, short *len)
{
	switch(index)
	{
		case 0:
			cmd[0] = addr;
			cmd[1] = 0x02;
			cmd[2] = 0x03;								
			cmd[3] = 0xF5;
			cmd[4] = 0x00;	
			cmd[5] = 0x01;
			*len = CRC16_Padding(cmd, 6);
			break;
		case 1:
			cmd[0] = addr;
			cmd[1] = 0x02;
			cmd[2] = 0x06;								
			cmd[3] = 0xDA;
			cmd[4] = 0x00;	
			cmd[5] = 0x04;
			*len = CRC16_Padding(cmd, 6);			
			break;
		case 2:
			cmd[0] = addr;
			cmd[1] = 0x02;
			cmd[2] = 0x08;								
			cmd[3] = 0x9E;
			cmd[4] = 0x00;	
			cmd[5] = 0x03;
			*len = CRC16_Padding(cmd, 6);			
			break;
		case 3:
			cmd[0] = addr;
			cmd[1] = 0x02;
			cmd[2] = 0x08;								
			cmd[3] = 0xA8;
			cmd[4] = 0x00;
			cmd[5] = 0x0B;
			*len = CRC16_Padding(cmd, 6);			
			break;		
		case 4:
			cmd[0] = addr;
			cmd[1] = 0x04;
			cmd[2] = 0x09;								
			cmd[3] = 0x2A;
			cmd[4] = 0x00;
			cmd[5] = 0x08;
			*len = CRC16_Padding(cmd, 6);			
			break;
		case 5:
			cmd[0] = addr;
			cmd[1] = 0x04;
			cmd[2] = 0x09;								
			cmd[3] = 0x50;
			cmd[4] = 0x00;
			cmd[5] = 0x08;
			*len = CRC16_Padding(cmd, 6);			
			break;		
		case 6:
			cmd[0] = addr;
			cmd[1] = 0x02;
			cmd[2] = 0x12;								
			cmd[3] = 0xC2;
			cmd[4] = 0x00;
			cmd[5] = 0x02;
			*len = CRC16_Padding(cmd, 6);			
			break;			
		case 7:
			cmd[0] = addr;
			cmd[1] = 0x02;
			cmd[2] = 0x13;								
			cmd[3] = 0x27;
			cmd[4] = 0x00;
			cmd[5] = 0x01;
			*len = CRC16_Padding(cmd, 6);			
			break;	
		case 8:
			cmd[0] = addr;
			cmd[1] = 0x02;
			cmd[2] = 0x13;								
			cmd[3] = 0x8B;
			cmd[4] = 0x00;
			cmd[5] = 0x01;
			*len = CRC16_Padding(cmd, 6);			
			break;	
		case 9:
			cmd[0] = addr;
			cmd[1] = 0x02;
			cmd[2] = 0x19;								
			cmd[3] = 0x02;
			cmd[4] = 0x00;
			cmd[5] = 0x01;
			*len = CRC16_Padding(cmd, 6);			
			break;	
		case 10:
			cmd[0] = addr;
			cmd[1] = 0x02;
			cmd[2] = 0x21;								
			cmd[3] = 0x80;
			cmd[4] = 0x00;
			cmd[5] = 0x01;
			*len = CRC16_Padding(cmd, 6);			
			break;
		case 11:
			cmd[0] = addr;
			cmd[1] = 0x02;
			cmd[2] = 0x1A;								
			cmd[3] = 0xF6;
			cmd[4] = 0x00;
			cmd[5] = 0x03;
			*len = CRC16_Padding(cmd, 6);			
			break;
		case 12:
			cmd[0] = addr;
			cmd[1] = 0x02;
			cmd[2] = 0x11;								
			cmd[3] = 0x33;
			cmd[4] = 0x00;
			cmd[5] = 0x03;
			*len = CRC16_Padding(cmd, 6);			
			break;
		case 13:
			cmd[0] = addr;
			cmd[1] = 0x02;
			cmd[2] = 0x21;								
			cmd[3] = 0x71;
			cmd[4] = 0x00;
			cmd[5] = 0x03;
			*len = CRC16_Padding(cmd, 6);			
			break;
		default:
			break;
	}
}


/**********************************************************************************************************
* 函数名称： static int parse_fun(short index, int addr, void *data, char *buf, short len)
* 函数说明： 解析传感器响应的数据，并写入数据库
* 输入参数： 解析索引,传感器地址，变量结构体指针，以及响应数据缓存取指针，响应数据长度
* 返回参数： 返回解析结果，返回0成功，返回1失败
**********************************************************************************************************/
static int parse_fun(short index, int addr, void *data, char *buf, short len)
{
	union{
		float			dat32;
      	unsigned char  	dat8[4];
    }DAT32_8;						   //数据类型转换
	
	Data_Struct	*d = (Data_Struct*)data;

	if(buf!=NULL && buf[0]==addr && len>0 )
	{	
		if(CRC16_Check(buf,len))
		{
			switch(index)
			{
				case 0:
					SetStringDataPoint(&d->OnOffStatus, buf[3]&0x01, Normal, Alarm, "开机", "关机");
					break;
				case 1:
					SetStringDataPoint(&d->CoolingMode,			buf[3]&0x01, ON, OFF, "开启", "停止");
					SetStringDataPoint(&d->HeatingMode,			buf[3]&0x02, ON, OFF, "开启", "停止");
					SetStringDataPoint(&d->HumidificationMode,	buf[3]&0x04, ON, OFF, "开启", "停止");
					SetStringDataPoint(&d->DehumidificationMode,buf[3]&0x08, ON, OFF, "开启", "停止");
					break;
				case 2:
					SetStringDataPoint(&d->WaterDetector,		buf[3]&0x01, Alarm, Normal, "报警", "正常");
					SetStringDataPoint(&d->PhaseCheck,			buf[3]&0x02, Alarm, Normal, "报警", "正常");
					SetStringDataPoint(&d->FireAlarm,			buf[3]&0x04, Alarm, Normal, "报警", "正常");
					break;
				case 3:
					if(buf[3]&0x01){
						SetStringDataPoint(&d->ReturnAirTempAlarm,	1, Alarm, Normal, "高温报警", "正常");
					}
					else if(buf[3]&0x20){
						SetStringDataPoint(&d->ReturnAirTempAlarm,	1, Alarm, Normal, "低温报警", "正常");
					}
					else{
						SetStringDataPoint(&d->ReturnAirTempAlarm,	0, Alarm, Normal, "报警", "正常");
					}
					
					if(buf[3]&0x02){
						SetStringDataPoint(&d->ReturnAirHumidAlarm,	1, Alarm, Normal, "高湿报警", "正常");
					}
					else if(buf[3]&0x40){
						SetStringDataPoint(&d->ReturnAirHumidAlarm,	1, Alarm, Normal, "低湿报警", "正常");
					}
					else{
						SetStringDataPoint(&d->ReturnAirHumidAlarm,	0, Alarm, Normal, "报警", "正常");
					}
					
					if(buf[3]&0x04){
						SetStringDataPoint(&d->SupplyAirTempAlarm,	1, Alarm, Normal, "高温报警", "正常");
					}
					else if(buf[3]&0x80){
						SetStringDataPoint(&d->SupplyAirTempAlarm,	1, Alarm, Normal, "低温报警", "正常");
					}
					else{
						SetStringDataPoint(&d->SupplyAirTempAlarm,	0, Alarm, Normal, "报警", "正常");
					}
					
					if(buf[3]&0x08){
						SetStringDataPoint(&d->SupplyAirHumidAlarm,	1, Alarm, Normal, "高湿报警", "正常");
					}
					else if(buf[4]&0x01){
						SetStringDataPoint(&d->SupplyAirHumidAlarm,	1, Alarm, Normal, "低湿报警", "正常");
					}
					else{
						SetStringDataPoint(&d->SupplyAirHumidAlarm,	0, Alarm, Normal, "报警", "正常");
					}
					break;
				case 4:
					DAT32_8.dat8[3] = buf[3];
					DAT32_8.dat8[2] = buf[4];
					DAT32_8.dat8[1] = buf[5];
					DAT32_8.dat8[0] = buf[6];
					d->SetpointTemperatureDay.value.fnum = DAT32_8.dat32;
					DAT32_8.dat8[3] = buf[7];
					DAT32_8.dat8[2] = buf[8];
					DAT32_8.dat8[1] = buf[9];
					DAT32_8.dat8[0] = buf[10];
					d->SetpointTemperatureNight.value.fnum = DAT32_8.dat32;					
					DAT32_8.dat8[3] = buf[15];
					DAT32_8.dat8[2] = buf[16];
					DAT32_8.dat8[1] = buf[17];
					DAT32_8.dat8[0] = buf[18];
					d->SetpointHumidity.value.fnum = DAT32_8.dat32;
					break;
				case 5:
					DAT32_8.dat8[3] = buf[3];
					DAT32_8.dat8[2] = buf[4];
					DAT32_8.dat8[1] = buf[5];
					DAT32_8.dat8[0] = buf[6];
					d->ReturnAirTemperature.value.fnum = DAT32_8.dat32;
					DAT32_8.dat8[3] = buf[7];
					DAT32_8.dat8[2] = buf[8];
					DAT32_8.dat8[1] = buf[9];
					DAT32_8.dat8[0] = buf[10];
					d->SupplyAirTemperature.value.fnum = DAT32_8.dat32;					
					DAT32_8.dat8[3] = buf[11];
					DAT32_8.dat8[2] = buf[12];
					DAT32_8.dat8[1] = buf[13];
					DAT32_8.dat8[0] = buf[14];
					d->ReturnAirHumidity.value.fnum = DAT32_8.dat32;				
					DAT32_8.dat8[3] = buf[15];
					DAT32_8.dat8[2] = buf[16];
					DAT32_8.dat8[1] = buf[17];
					DAT32_8.dat8[0] = buf[18];
					d->SupplyAirHumidity.value.fnum = DAT32_8.dat32;
					break;
				case 6:
					SetStringDataPoint(&d->ElectricHeatingAlarm,		buf[3]&0x01, Alarm, Normal, "报警", "正常");
					SetStringDataPoint(&d->ElectricHeating1Running,		buf[3]&0x02, ON, OFF, "开启", "停止");
					break;
				case 7:
					SetStringDataPoint(&d->ElectricHeating2Running,		buf[3]&0x01, ON, OFF, "开启", "停止");
					break;
				case 8:
					SetStringDataPoint(&d->ElectricHeating3Running,		buf[3]&0x01, ON, OFF, "开启", "停止");
					break;
				case 9:
					SetStringDataPoint(&d->Humidifier1Running,			buf[3]&0x01, ON, OFF, "开启", "停止");					
					break;
				case 10:
					SetStringDataPoint(&d->Humidifier1Alarm,			buf[3]&0x01, Alarm, Normal, "报警", "正常");
					break;
				case 11:
					SetStringDataPoint(&d->Fan1Running,					buf[3]&0x01, ON, OFF, "开启", "停止");
					SetStringDataPoint(&d->fan1Alarm,					buf[3]&0x02, Alarm, Normal, "报警", "正常");
					SetStringDataPoint(&d->Fan1FilterAlarm,				buf[3]&0x04, Alarm, Normal, "报警", "正常");
					break;
				case 12:
					SetStringDataPoint(&d->Compressor1Running,			buf[3]&0x01, ON, OFF, "开启", "停止");
					if(buf[3]&0x02){
						SetStringDataPoint(&d->Loop1PressureAlarm,	1, Alarm, Normal, "高压报警", "正常");
					}
					else if(buf[3]&0x04){
						SetStringDataPoint(&d->Loop1PressureAlarm,	1, Alarm, Normal, "低压报警", "正常");
					}
					else{
						SetStringDataPoint(&d->Loop1PressureAlarm,	0, Alarm, Normal, "报警", "正常");
					}
					break;
				case 13:
					SetStringDataPoint(&d->Compressor2Running,			buf[3]&0x01, ON, OFF, "开启", "停止");
					if(buf[3]&0x02){
						SetStringDataPoint(&d->Loop2PressureAlarm,	1, Alarm, Normal, "高压报警", "正常");
					}
					else if(buf[3]&0x04){
						SetStringDataPoint(&d->Loop2PressureAlarm,	1, Alarm, Normal, "低压报警", "正常");
					}
					else{
						SetStringDataPoint(&d->Loop2PressureAlarm,	0, Alarm, Normal, "报警", "正常");
					}
					break;
				default:
					break;
			}
			return 0;
		}
	}
	return 1;
}


/**********************************************************************************************************
* 函数名称： void jmkt_C7000_Registration(void)
* 函数说明： 精密空调驱动注册
* 输入参数： 无
* 返回参数： 无
**********************************************************************************************************/
void jmkt_C7000_Registration(void)
{
	DeviceDriverRegistration(
		"jmkt",													//设备类型
		"精密空调",												//设备名称（导航栏默认显示名称）
		"世图兹",												//设备品牌
		"C7000",												//设备型号
		"适用于世图兹控制器为C7000，CPD或CSD型精密空调，例如CPD512A、CSD521A。",//驱动描述
		var_attr,												//变量属性声明
		sizeof(Data_Struct),									//变量结构体空间大小
		cmd_fun,												//发送指令生成函数
		parse_fun,												//数据解析函数
		800														//设备响应超时时间
	);
	
#if 0 || VirtualFrameEN
	#define	CMD1	"\x01\x02\x03\xF5\x00\x01\xA9\xBC"
	#define	RSP1	"\x01\x02\x01\x01\x60\x48"
	#define	CMD2	"\x01\x02\x06\xDA\x00\x04\x58\xBA"
	#define	RSP2	"\x01\x02\x01\x01\x60\x48"
	#define	CMD3	"\x01\x02\x08\x9E\x00\x03\x5B\x85"
	#define	RSP3	"\x01\x02\x01\x00\xA1\x88"
	#define	CMD4	"\x01\x02\x08\xA8\x00\x0B\xBA\x4D"
	#define	RSP4	"\x01\x02\x02\x00\x00\xB9\xB8"		
	#define	CMD5	"\x01\x04\x09\x2A\x00\x08\xD3\x98"
	#define	RSP5	"\x01\x04\x10\x41\x98\x00\x00\x41\xD8\x00\x00\x41\x98\x00\x00\x42\x18\x00\x00\x0B\x33"		
	#define	CMD6	"\x01\x04\x09\x50\x00\x08\xF2\x41"
	#define	RSP6	"\x01\x04\x10\x41\x99\x99\x9A\x00\x00\x00\x00\x42\x3A\xCC\xCD\x00\x00\x00\x00\x9F\x12"		
	#define	CMD7	"\x01\x02\x12\xC2\x00\x02\x5D\x4F"
	#define	RSP7	"\x01\x02\x01\x00\xA1\x88"
	#define	CMD8	"\x01\x02\x13\x27\x00\x01\x0D\x45"
	#define	RSP8	"\x01\x02\x01\x00\xA1\x88"
	#define	CMD9	"\x01\x02\x13\x8B\x00\x01\xCD\x64"
	#define	RSP9	"\x01\x02\x01\x00\xA1\x88"		
	#define	CMD10	"\x01\x02\x19\x02\x00\x01\x1F\x56"
	#define	RSP10	"\x01\x02\x01\x00\xA1\x88"		
	#define	CMD11	"\x01\x02\x21\x80\x00\x01\xB2\x1E"
	#define	RSP11	"\x01\x02\x01\x00\xA1\x88"	
	#define	CMD12	"\x01\x02\x1A\xF6\x00\x03\xDF\x21"
	#define	RSP12	"\x01\x02\x01\x01\x60\x48"
	#define	CMD13	"\x01\x02\x11\x33\x00\x03\xCD\x38"
	#define	RSP13	"\x01\x02\x01\x00\xA1\x88"
	#define	CMD14	"\x01\x02\x21\x71\x00\x03\x62\x2C"
	#define	RSP14	"\x01\x02\x01\x00\xA1\x88"

	VirtualFrameRegistration(CMD1,  sizeof(CMD1)-1,  RSP1,  sizeof(RSP1)-1);
	VirtualFrameRegistration(CMD2,  sizeof(CMD2)-1,  RSP2,  sizeof(RSP2)-1);
	VirtualFrameRegistration(CMD3,  sizeof(CMD3)-1,  RSP3,  sizeof(RSP3)-1);
	VirtualFrameRegistration(CMD4,  sizeof(CMD4)-1,  RSP4,  sizeof(RSP4)-1);
	VirtualFrameRegistration(CMD5,  sizeof(CMD5)-1,  RSP5,  sizeof(RSP5)-1);
	VirtualFrameRegistration(CMD6,  sizeof(CMD6)-1,  RSP6,  sizeof(RSP6)-1);
	VirtualFrameRegistration(CMD7,  sizeof(CMD7)-1,  RSP7,  sizeof(RSP7)-1);
	VirtualFrameRegistration(CMD8,  sizeof(CMD8)-1,  RSP8,  sizeof(RSP8)-1);
	VirtualFrameRegistration(CMD9,  sizeof(CMD9)-1,  RSP9,  sizeof(RSP9)-1);
	VirtualFrameRegistration(CMD10, sizeof(CMD10)-1, RSP10, sizeof(RSP10)-1);
	VirtualFrameRegistration(CMD11, sizeof(CMD11)-1, RSP11, sizeof(RSP11)-1);
	VirtualFrameRegistration(CMD12, sizeof(CMD12)-1, RSP12, sizeof(RSP12)-1);
	VirtualFrameRegistration(CMD13, sizeof(CMD13)-1, RSP13, sizeof(RSP13)-1);
	VirtualFrameRegistration(CMD14, sizeof(CMD14)-1, RSP14, sizeof(RSP14)-1);	
#endif	
}

